import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";
const module = '/product/productSpec'

export function listProductSpecAll(c3id){

    return request({
      url: module+'/list/' + c3id,
      method: 'get',
    })
}


// 查询商品规格列表
export function listProductSpec(query) {
  return request({
    url: module+'/'+'list',
    method: 'get',
    params: query
  })
}

// 查询商品规格详细
export function getProductSpec(SpecId) {
  return request({
    url: module +'/'+ parseStrEmpty(SpecId),
    method: 'get'
  })
}

// 新增商品规格
export function addProductSpec(data) {
  return request({
    url: module,
    method: 'post',
    data: data
  })
}

// 修改商品规格
export function updateProductSpec(data) {
  return request({
    url: module,
    method: 'put',
    data: data
  })
}

// 删除商品规格
export function delProductSpec(ids) {
  return request({
    url: module +'/'+ ids,
    method: 'delete'
  })

}
// 根据分类id获取商品规格列表
export function slectSpecListByCategoryId(categoryBrandId) {
  return request({
    url: module +'/brandList/'+ categoryBrandId,
    method: 'get'
  })

}
